#ifndef DATABASE_SQLITE3_H
#define DATABASE_SQLITE3_H

#include "database.h"

struct sqlite3;

namespace Zen{

class database_sqlite3 : public database
{
private:
	sqlite3* sqlite;

	tstring path_, key_;

public:
	database_sqlite3(const tstring& path, const tstring& key/* = TEXT("")*/);
	virtual ~database_sqlite3(void);

	virtual bool open();

	virtual void close();

	virtual bool is_open();

	virtual bool get_table(const tstring& sql, table_type& table);

	virtual bool get_table(const tstring& sql, table_type& table, int& records);

	virtual bool execute(const tstring& sql);

	virtual bool begin_transaction();

	virtual bool commit_transaction();

	virtual bool exist_table(const tstring& table);

	bool reset_password();

private:
	virtual tstring _error_message();

	tstring _error_message(const char* error_msg);

};

}

#endif

